/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author diego
 */
@Entity
@Table(name = "Perfil_Operacion")
public class Perfil_Operacion implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Basic(optional = false)
    @Column(name = "idPO")
    private Integer idPO;
    @JoinColumn(name = "idPerfil", referencedColumnName = "idPerfil")
    @ManyToOne
    private Perfil idPerfil;
    @JoinColumn(name = "idOperaciones", referencedColumnName = "idOperaciones")
    @ManyToOne
    private Operaciones idOperaciones;

    public Perfil_Operacion() {
    }

    public Perfil_Operacion(Integer idPerfil_Operacion) {
        this.idPO = idPerfil_Operacion;
    }

    public Perfil getIdPerfil() {
        return idPerfil;
    }

    public void setIdPerfil(Perfil idPerfil) {
        this.idPerfil = idPerfil;
    }

    public Operaciones getIdOperaciones() {
        return idOperaciones;
    }

    public void setIdOperaciones(Operaciones idOperaciones) {
        this.idOperaciones = idOperaciones;
    }

    public Integer getIdPO() {
        return idPO;
    }

    public void setIdPO(Integer idPO) {
        this.idPO = idPO;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPO != null ? idPO.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Perfil_Operacion)) {
            return false;
        }
        Perfil_Operacion other = (Perfil_Operacion) object;
        if ((this.idPO == null && other.idPO != null) || (this.idPO != null && !this.idPO.equals(other.idPO))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return idPO.toString();
    }
}
